package com.gupao.javavip.rpc.server;

import com.gupao.javavip.rpc.api.IUserService;
import com.gupao.javavip.rpc.api.dto.AddUserRequest;
import com.gupao.javavip.rpc.framework.protocol.RPCServiceMapping;
import com.gupao.javavip.rpc.framework.protocol.RPCServiceProvider;
import org.springframework.stereotype.Component;

@Component
@RPCServiceProvider(service = com.gupao.javavip.rpc.api.IUserService.class)
public class UserServiceServer implements IUserService {
    @Override
    @RPCServiceMapping(method = "addUser")
    public Long addUser(AddUserRequest request) {
        System.out.println("收到RPC调用:" + request.toString());
        return 1L;
    }

    @Override
    @RPCServiceMapping(method = "sayHello")
    public void sayHello() {
        System.out.println("收到RPC调用");
    }
}
